from .models import *
# urls.py (主路由配置)
from django.urls import include, path
from rest_framework.routers import DefaultRouter
from .views import (ArticleViewSet, CategoryViewSet, TagViewSet,
                    TopicsViewSet, ImageUploadView)

router = DefaultRouter()
router.register(r'articles', ArticleViewSet, basename='article')
router.register(r'topics', TopicsViewSet, basename='topic')
router.register(r'categories', CategoryViewSet, basename='category')
router.register(r'tags', TagViewSet, basename='tag')


urlpatterns = [
    path('', include(router.urls)),
    path('upload/image/', ImageUploadView.as_view(), name='image-upload'),

    # 其他API路径...
]
